# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=postgresql-mysql_fdw
_projname=mysql_fdw
pkgver=2.9.2
_pkgver=REL-${pkgver//./_}
pkgrel=0
pkgdesc="PostgreSQL foreign data wrapper for MySQL/MariaDB"
url="https://github.com/EnterpriseDB/mysql_fdw"
arch="all"
license="PostgreSQL"
makedepends="mariadb-connector-c-dev postgresql-dev"
source="https://github.com/EnterpriseDB/mysql_fdw/archive/$_pkgver/$pkgname-$pkgver.tar.gz
	fix-RTLD_DEEPBIND-check.patch
	"
builddir="$srcdir/$_projname-$_pkgver"
options="!check"  # FIXME: requires running PostgreSQL

export USE_PGXS=1

build() {
	make
}

check() {
	make installcheck
}

package() {
	depends="postgresql$(pg_config --major-version)"

	make install DESTDIR="$pkgdir"
}

sha512sums="
3f05d6bf980f4c119b872a6d0da7f7761bea2d6b47ef92d1ed6f71408ee00d5304a9feec5474bd17100aa0eeafc980b51fcf5a657fa4c0b7c7ce24de2effcebd  postgresql-mysql_fdw-2.9.2.tar.gz
60ec2f8b026a52ac3f1c62b425bfe882fc321d3bd24646c513922a3a51c38efd44f3bb70d77f8ce94ff9db6f2554481c3e4a4b3458fb72060368f47921471f50  fix-RTLD_DEEPBIND-check.patch
"
